import subprocess
import random

def run_analysis(video_path):
    script_path = '/home/user3/mmaction2_YF_2/express/run.sh'
    try:
        result = subprocess.run(
            ['bash', script_path, video_path],
            stdout=subprocess.PIPE,
            stderr=subprocess.PIPE,
            timeout=120,
            encoding='utf-8'
        )
        if result.returncode != 0:
            return {'success': False, 'error': result.stderr}
        return {'success': True, 'result': result.stdout}
    except Exception as e:
        return {'success': False, 'error': str(e)}

def generate_account():
    length = random.randint(6, 9)
    return ''.join([str(random.randint(0, 9)) for _ in range(length)])